$primary-color: #2980b9;

$drawer-background: #2c3e50;
$drawer-title-background: $primary-color;
$drawer-title-color: #ecf0f1;
$drawer-item-color: #bdc3c7;
$drawer-item-color-highlight: #ecf0f1;
$chip-color: #e67e22;

html {
  box-sizing: border-box;
}

*, *:before, *:after {
  box-sizing: inherit;
}

body {
  padding-left: 1rem;
  padding-right: 1rem;
}

.search {
  padding: 0.5rem;
  display: flex;
  flex-direction: row;
  img {
    height: 2.4rem;
    padding-left: 2rem;
    padding-top: 0.1rem;
    padding-right: 0.5rem;
  }
  .search-input-wrapper {
    display: inline-block;
    position: relative;
    padding-left: 0.2rem;
    padding-top: 0.2rem;
    padding-bottom: 0.2rem;
    border: 1px solid $primary-color;
    border-radius: 1rem 0rem 0rem 1rem;
    flex-grow: 1;

    input {
      padding-left: 0.8rem;
      padding-top: 0.8rem;
      padding-bottom: 0.8rem;
      margin-left: 1rem;
      width: 100%;
      background-color: transparent;
      border: none;
    }
    input:hover {
      border: none;
    }
    input:focus {
      border: none;
    }

    #suggestion {
      position: absolute;
      left: 0;
      width: 100%;
      border: 1px solid $primary-color;
      background-color: white;
      a {
        display: block;
        text-decoration: none;
        border: none;
        padding-left: 2rem;
        padding-right: 2rem;
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
        text-align: left;
      }
    }
  }
  button {
    border: 1px solid $primary-color;
    border-radius: 0rem 1rem 1rem 0rem;
    padding: 0.4rem 1rem 0.4rem 0.4rem;
    background-color: $primary-color;
    color: #ffffff;
  }

  button:hover {
    background-color: darken($primary-color, 10%)
  }
}

nav[role=chips] {
  padding-top: 1.5rem;

  .chips {
    a {
      background: url('remove.svg');
      background-size: 1.6rem 1.6rem;
      background-repeat: no-repeat;
      border: 1px solid $chip-color;
      background-color: $chip-color;
      color: white;
      border-radius: 0.3rem;
      padding-left: 1.5rem;
      padding-top: 0.3rem;
      padding-bottom: 0.3rem;
      padding-right: 0.3rem;
      display: inline-block;
    }
    a:hover {
      border: 1px solid lighten($chip-color, 20%);
      background-color: lighten($chip-color, 20%);
    }
  }
}

nav[role=facet] {
  padding-top: 1rem;
  display: flex;
  flex-direction: row;
  border-bottom: 1px solid black;
  ul {
    list-style: none;
    margin: 0;
    padding-left: 0;
  }
  li {
    color: #fff;
    display: block;
    float: left;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    padding-left: 1rem;
    padding-right: 1rem;
    position: relative;
    text-decoration: none;
  }
  ul li ul li {
    clear: both;
    width: 100%;
  }
  div.menu {
    display: none;
    border-top: 0.2rem solid $primary-color;
    border-left: 1px solid $primary-color;
    border-right: 1px solid $primary-color;
    border-bottom: 1px solid $primary-color;
    color: black;
    white-space: pre;
    background-color: white;

    a {
      display: block;
      padding: 0.5rem;
    }
    a:hover {
      color: $primary-color;
    }
  }
  input[type=checkbox]:checked~div.menu {
    display: inline-block;
    position: absolute;
    top: 2.1rem;
    left: 0.5rem;
    padding: 0.5rem;
  }
  label {
    padding: 0.5rem;
    border-bottom: 0.2rem solid transparent;
    transition-duration: 0.3s;
  }
  label:hover {
    border-bottom: 0.2rem solid #0074D9;
  }
  input[type=checkbox]:checked+label {
    border-bottom: 0.2rem solid #0074D9;
  }
}

a {
  text-decoration: none;
  color: black;
}

input[type=checkbox] {
  display: none;
}

#drawer-toggle {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  left: 1rem;
  height: 50px;
  width: 50px;
  display: block;
  position: absolute;
  background: rgba(255, 255, 255, .0);
  z-index: 1;
  padding-right: 1rem;
}

#drawer-toggle:before {
  content: '';
  display: block;
  position: absolute;
  height: 2px;
  width: 24px;
  background: #8d8d8d;
  left: 13px;
  top: 28px;
  box-shadow: 0 6px 0 #8d8d8d, 0 12px 0 #8d8d8d;
}

aside {
  position: absolute;
  top: 0px;
  left: -400px;
  width: 20%;
  height: 100%;
  background: $drawer-background;
  transition-duration: 0.3s;
  z-index: 100;
  color: $drawer-item-color;
  display: flex;
  flex-direction: column;
  border-right: 1px solid black;

  div {
    padding: 0.8rem;
  }

  .title {
    background: $drawer-title-background;
    color: $drawer-title-color;
  }

  .item {
    display: block;
    text-decoration: none;
    padding-left: 1.5rem;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    color: $drawer-item-color;
  }

  .item:hover {
    color: $drawer-item-color-highlight;
  }

  .search:before {
    width: 1rem;
    height: 1rem;
    background-image: url('search-white.svg');
    background-size: cover;
    display: inline-block;
    position: relative;
    top: 0.2rem;
    left: -0.6rem;
    content: ' ';
  }

  .settings:before {
    width: 1rem;
    height: 1rem;
    background-image: url('gear-white.svg');
    background-size: cover;
    display: inline-block;
    position: relative;
    top: 0.2rem;
    left: -0.6rem;
    content: ' ';
  }

  .close:before {
    width: 1rem;
    height: 1rem;
    background-image: url('window-close-white.svg');
    background-size: cover;
    display: inline-block;
    position: relative;
    top: 0.2rem;
    left: -0.6rem;
    content: ' ';
  }
}

#drawer:checked+#drawer-toggle {
  width: calc(100% - 20%);
  height: 100%;
  background: rgba(255, 255, 255, 0.8);
  left: calc(100% - 80%);
}

#drawer:checked+#drawer-toggle:before {
  box-shadow: none;
  background: none;
  display: none;
}

#drawer:checked~aside {
  left: 0px;
}

.summarytext {
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.resultentry {
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
  line-height: 1.33;
  display: flex;
  flex-direction: row;
  align-items: flex-start;

  .image  {
    width: 160px;
    max-width: 160px;
    text-align: center;
  }

  img {
    max-width: 160px;
  }

  .text {
    flex-grow: 1;
    padding-left: 0.5rem;

    .entrytitle {
      color: rgb(26, 13, 171);
      font-size: 1.1rem;
      padding-bottom: 0.2rem;
      text-decoration: none;
      display: block;
      cursor: pointer;
    }

    .filename {
      display: block;
      text-decoration: none;
      color: rgb(0, 102, 33);
      cursor: pointer;
    }

    .entrytext {
      color: rgb(84, 84, 84);

      em {
        color: black;
        font-weight: bold;
        font-style: normal;
      }
    }
  }

  .starsouter {
    width: 10rem;
    height: 1rem;
  }

  .stars-full {
    width: 1rem;
    background: url('star.svg');
    background-size: cover;
    height: 1rem;
    display: inline-block;
  }

  .stars-empty {
    width: 1rem;
    background: url('star-o.svg');
    background-size: cover;
    height: 1rem;
    display: inline-block;
  }
}

.welcome {
  padding-top: 5rem;
  text-align: center;
  width: 100%;

  .introduction {
    mark {
      font-weight: bold;
      background-color: transparent;
    }
    div {
      padding-left: 8rem;
      padding-right: 8rem;
      padding-top: 0.2rem;
      padding-bottom: 0.2rem;
    }
  }
}

.hidden {
  display: none;
}